//
//  SDNetOperation.h
//  SDDataTest
//
//  Created by ding wei on 12-10-4.
//  Copyright (c) 2012年 sodao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ASIHTTPRequest.h"
#import "ASIFormDataRequest.h"
#import "SDNetURLMap.h"
#import "SDAPIName.h"

#define NotificationParamError  @"ParamError"

#define isTestServer  0
#define DefaultTimeOutSeconeds   10

typedef void (^CompleteWithString)(NSString* responseString);
typedef void (^FailWithString)(NSString* responseString,NSError* error);

@interface SDNetOperation : NSObject
{
    NSOperationQueue* _operationQueue;
    SDNetURLMap*        _URLMap;
}
-(NSString*)sendRequestByName:(NSString*)name
                     getParam:(NSDictionary*)get
                    postParam:(NSDictionary*)post
                    restParam:(NSDictionary*)rest
                     postType:(int)type
                        token:(NSString*)token
                     deviceID:(NSString*)deviceID
                responseBlock:(CompleteWithString)complete
                    failBlock:(FailWithString)fail;
+(SDNetOperation*)shareInstance;

@end
